Optimal. Leaf size=78 \[ -\frac {(a+b) \tan ^{-1}\left (\frac {\sqrt {b} \cos (e+f x)}{\sqrt {a+b-b \cos ^2(e+f x)}}\right )}{2 \sqrt {b} f}-\frac {\cos (e+f x) \sqrt {a+b-b \cos ^2(e+f x)}}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3265, 201, 223,
209} \begin {gather*} -\frac {(a+b) \text {ArcTan}\left (\frac {\sqrt {b} \cos (e+f x)}{\sqrt {a-b \cos ^2(e+f x)+b}}\right )}{2 \sqrt {b} f}-\frac {\cos (e+f x) \sqrt {a-b \cos ^2(e+f x)+b}}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 201
Rule 209
Rule 223
Rule 3265
Rubi steps
\begin {align*} \int \sin (e+f x) \sqrt {a+b \sin ^2(e+f x)} \, dx &=-\frac {\text {Subst}\left (\int \sqrt {a+b-b x^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\cos (e+f x) \sqrt {a+b-b \cos ^2(e+f x)}}{2 f}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{\sqrt {a+b-b x^2}} \, dx,x,\cos (e+f x)\right )}{2 f}\\ &=-\frac {\cos (e+f x) \sqrt {a+b-b \cos ^2(e+f x)}}{2 f}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{1+b x^2} \, dx,x,\frac {\cos (e+f x)}{\sqrt {a+b-b \cos ^2(e+f x)}}\right )}{2 f}\\ &=-\frac {(a+b) \tan ^{-1}\left (\frac {\sqrt {b} \cos (e+f x)}{\sqrt {a+b-b \cos ^2(e+f x)}}\right )}{2 \sqrt {b} f}-\frac {\cos (e+f x) \sqrt {a+b-b \cos ^2(e+f x)}}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 93, normalized size = 1.19 \begin {gather*} -\frac {\sqrt {2} \cos (e+f x) \sqrt {2 a+b-b \cos (2 (e+f x))}+\frac {2 (a+b) \log \left (\sqrt {2} \sqrt {-b} \cos (e+f x)+\sqrt {2 a+b-b \cos (2 (e+f x))}\right )}{\sqrt {-b}}}{4 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(181\) vs.
\(2(66)=132\).
time = 7.56, size = 182, normalized size = 2.33
method | result | size |
default | \(\frac {\sqrt {\left (\cos ^{2}\left (f x +e \right )\right ) \left (a +b \left (\sin ^{2}\left (f x +e \right )\right )\right )}\, \left (b \arctan \left (\frac {-2 b \left (\cos ^{2}\left (f x +e \right )\right )+a +b}{2 \sqrt {b}\, \sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}}\right )+a \arctan \left (\frac {-2 b \left (\cos ^{2}\left (f x +e \right )\right )+a +b}{2 \sqrt {b}\, \sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}}\right )-2 \sqrt {b}\, \sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}\right )}{4 \sqrt {b}\, \cos \left (f x +e \right ) \sqrt {a +b \left (\sin ^{2}\left (f x +e \right )\right )}\, f}\) | \(182\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.54, size = 74, normalized size = 0.95 \begin {gather*} -\frac {\frac {a \arcsin \left (\frac {b \cos \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {b}} + \sqrt {b} \arcsin \left (\frac {b \cos \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right ) + \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} \cos \left (f x + e\right )}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs.
\(2 (66) = 132\).
time = 0.50, size = 433, normalized size = 5.55 \begin {gather*} \left [-\frac {8 \, \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} b \cos \left (f x + e\right ) + {\left (a + b\right )} \sqrt {-b} \log \left (128 \, b^{4} \cos \left (f x + e\right )^{8} - 256 \, {\left (a b^{3} + b^{4}\right )} \cos \left (f x + e\right )^{6} + 160 \, {\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} \cos \left (f x + e\right )^{4} + a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4} - 32 \, {\left (a^{3} b + 3 \, a^{2} b^{2} + 3 \, a b^{3} + b^{4}\right )} \cos \left (f x + e\right )^{2} + 8 \, {\left (16 \, b^{3} \cos \left (f x + e\right )^{7} - 24 \, {\left (a b^{2} + b^{3}\right )} \cos \left (f x + e\right )^{5} + 10 \, {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \cos \left (f x + e\right )^{3} - {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} \sqrt {-b}\right )}{16 \, b f}, \frac {{\left (a + b\right )} \sqrt {b} \arctan \left (\frac {{\left (8 \, b^{2} \cos \left (f x + e\right )^{4} - 8 \, {\left (a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a^{2} + 2 \, a b + b^{2}\right )} \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} \sqrt {b}}{4 \, {\left (2 \, b^{3} \cos \left (f x + e\right )^{5} - 3 \, {\left (a b^{2} + b^{3}\right )} \cos \left (f x + e\right )^{3} + {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \cos \left (f x + e\right )\right )}}\right ) - 4 \, \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} b \cos \left (f x + e\right )}{8 \, b f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \sin ^{2}{\left (e + f x \right )}} \sin {\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.88, size = 83, normalized size = 1.06 \begin {gather*} -\frac {\sqrt {-b \cos \left (f x + e\right )^{2} + a + b} \cos \left (f x + e\right )}{2 \, f} - \frac {{\left (a + b\right )} \log \left ({\left | \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} + \frac {\sqrt {-b f^{2}} \cos \left (f x + e\right )}{f} \right |}\right )}{2 \, \sqrt {-b} {\left | f \right |}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sin \left (e+f\,x\right )\,\sqrt {b\,{\sin \left (e+f\,x\right )}^2+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________